import Request from './index.js'
let request = new Request().http
/**
 * @param {Object} data 入参
 * @param {Object} type 请求接口类型：0-新接口php； 1-英文
 * @param {Object} url 接口
 * @param {Object} hideLoading
 * @param {Object} header
 */
function get(data, type, url, hideLoading = true, header = true) {
	return request({
		url: url,
		method: 'GET',
		data: data,
		header: header,
		hideLoading: hideLoading,
		type
	})
}

function post(data, type, url, hideLoading = true, header = true) {

	// console.log(">>>>>>>>>>>>>>>111>>>>>>>>>>>>>>>>>>>>>>>>>>>");
	// console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
	// console.log({
	// 	url: url,
	// 	method: 'POST',
	// 	data: data,
	// 	header: header,
	// 	hideLoading: hideLoading,
	// 	type
	// });
	return request({
		url: url,
		method: 'POST',
		data: data,
		header: header,
		hideLoading: hideLoading,
		type
	})
}

function del(data, type, url, hideLoading = true, header = true) {
	return request({
		url: url,
		method: 'DELETE',
		data: data,
		header: header,
		hideLoading: hideLoading,
		type
	})
}

// 所有接口，在这写9841
let api = {
	// 登录(验证码、密码)
	appLogin: data => post(data, 0, 'common/ajax_login', false),
	// 人脸登录
	faceLogin: data => post(data, 0, 'user/ajax_check_avatar'),
	// 检查是否可以面容登录
	checkFaceLogin: data => post(data, 0, 'common/ajax_face_login_is_able'),
	// 通过手机号获取用户信息
	getUserInfoByPhone: data => post(data, 0, 'user/ajax_userinfo_by_phone', false),
	// 发送验证码
	sendSmsCode: data => post(data, 0, 'common/get_phone_code', false),
	// 获取用户信息
	getUserInfo: data => post(data, 0, 'user/ajax_user_info'),
	// 获取分类信息
	getbaseTypeInfo: data => post(data, 0, 'user/ajax_base_type_info'),
	// 保存用户信息
	saveUserInfo: data => post(data, 0, 'user/ajax_save_user_info'),
	// 保存用户头像信息
	saveAvatarInfo: data => post(data, 0, 'user/ajax_save_avatar'),
	// 保存mp3信息
	saveMp3Info: data => post(data, 0, 'user/ajax_save_mp3'),
	// 获取非官方词库分类
	getWordNineList: data => get(data, 1, 'wordThesaurus/nineList', false),
	// 获取词库分类
	getSysDictDataList: data => get(data, 1, 'dict/getSysDictDataList', false),
	// 获取词库列表
	getAppletsProductList: data => get(data, 1, 'product/getAppletsProductList', false),
	// 获取词库产品下单词
	wordThesaurus: data => get(data, 1, 'wordThesaurus/spbcnInfoFile', false),
	// 获取词库下单词
	spbcnInfoById: data => get(data, 1, 'wordThesaurus/spbcnInfoByIdFile', false),
	// 获取词库下单词
	spbcnInfoByPage: data => get(data, 1, 'wordThesaurus/spbcnInfoByPage', false),
	// 获取词库下单词
	spbcnInfoByIdPage: data => get(data, 1, 'wordThesaurus/spbcnInfoByIdPage', false),
	// 获取非官方词库下单词列表
	nineWordListByIdPage: data => get(data, 1, 'wordThesaurus/nineWordList', false),


	// 获取单词详情
	getWordInfo: data => get(data, 1, 'wordThesaurus/getWordInfo', false),
	// 单词反馈
	wordFeedback: data => post(data, 1, 'wordThesaurus/feedback'),
	// 获取产品详细信息
	getAppletsProduct: data => get(data, 1, 'product/getAppletsProduct', false),
	// 获取baby词库列表
	babyList: data => get(data, 1, 'wordThesaurus/babyList', false),
	// 获取词源列表
	languageOriginList: data => get(data, 1, 'wordThesaurus/languageOriginList', false),
	// 获取蜂计划列表
	beePlanList: data => get(data, 1, 'beePlan/list', false),
	// 获取蜂计划词库列表
	findAllBeePlanWordList: data => post(data, 1, 'beePlan/getWords'),
	// 获取词库下单词总数
	wordCount: data => get(data, 1, 'wordThesaurus/wordCount', false),
	// 获取蜂计划购买状态
	checkExpire: data => get(data, 1, 'beePlan/checkExpire', false),
	// 创建蜂计划
	createBeeplan: data => post(data, 1, 'beePlan/create'),
	// 获取计划详情
	beePlanInfo: data => get(data, 1, 'beePlan/info', false),
	// 获取打卡日期安排
	beeplanLogs: data => get(data, 1, 'beePlan/logs', false),
	// 删除蜂计划
	deleteBeePlan: data => del(data, 1, 'beePlan/delete'),
	// 根据日期获取打卡记录
	getBeePlanLogInfo: data => get(data, 1, 'beePlan/logInfo', false),
	// 获取生词复习测试接口
	reviewErrorBeePlanWord: data => get(data, 1, 'entertainment/app/beePlan/reviewErrorBeePlanWord', false),
	// 提交复习的生词
	reviewErrWord: data => post(data, 1, 'beePlan/reviewErrWord'),
	// 提交打卡记录
	punchClockSubmit: data => post(data, 1, 'beePlan/punchClock'),
	// 获取打卡数据
	getPnchClockLog: data => post(data, 1, 'beePlan/punchClockLog'),
	// 获取学校 /common/getSchoolList?provinceCode=110000&cityCode=110100&areaCode=110102
	getSchoolList: data => get(data, 1, 'common/getSchoolList', false),


	getPnchClockLog: data => post(data, 1, 'beePlan/punchClockLog'),
	// 获取生词列表
	getErrorBeePlanWordList: data => get(data, 1, 'beePlan/errWOrdlist', false),
	// 获取复习生词
	getReviewErrWord: data => get(data, 1, 'beePlan/getReviewErrWord', false),
	// 开启关闭生词打卡
	openErrorSwitch: data => post(data, 1, 'beePlan/errorSwitch'),
	//获取蜂计划徽章
	getBeePlanUserBadgeList: data => get(data, 1, "beePlan/getBeePlanUserBadgeList", false),
	//获取蜂计划某类型徽章
	getBeePlanBadgeSeries: data => get(data, 1, "beePlan/getBeePlanBadgeSeries", false),
	// 获取蜂计划积分列表
	getBeePlanPointsRecordList: data => get(data, 1, "beePlan/getBeePlanPointsRecordList", false),
	// 获取邀约记录
	getInvitedList: data => get(data, 1, "beePlan/getPlanBeeInvitedList", false),
	// 获取排行榜列表
	getBeePlanLaddersList: data => get(data, 1, "beePlan/getBeePlanLaddersList", false),
	// 周榜月榜列表
	getBeePlanLaddersManageList: data => get(data, 1, 'beePlan/getBeePlanLaddersManageList', false),
	// 获取团体赛小学组词库
	primarySchoolList: data => get(data, 1, 'wordThesaurus/primarySchoolList', false),

	// 张腾瑞======================================================================
	// 获取房间列表
	getRoomList: data => get(data, 0, 'group/ajax_list', false, false),
	// 获取系统房间
	getInitSystemRoom: data => get(data, 0, 'group/ajax_system_room_list', true, false),
	// 获取匹配的房间列表
	getPipeiRoomList: data => get(data, 0, 'group/ajax_pipei_list', false),
	// 创建房间
	createRoom: data => post(data, 0, 'group/ajax_create_room', false),
	// 进群之前检查是否可以进群，群人数是否已满，如果满的情况下是否是群成员
	checkBeforeEnterRoom: data => post(data, 0, 'group/ajax_check_before_enter_room'),
	// 获取游戏列表
	getGameList: data => get(data, 0, 'game/ajax_list', false),
	// 获取游戏对象数据
	getGameObject: data => get(data, 0, 'game/ajax_game_object', false),
	// 获取排行榜列表
	getRankList: data => get(data, 0, 'rank/ajax_list', false),
	// 大排行榜
	getBigRankList: data => post(data, 0, 'bigrank/ajax_list'),
	// 获取比赛有没有结束
	getMatchStatusInfo: data => get(data, 0, 'group/ajax_match_status_info', false),
	// 获取房间信息
	getGroupInfo: data => get(data, 0, 'group/ajax_group_info', false),
	// 获取房间是否有效
	getGroupValidStatus: data => get(data, 0, 'group/ajax_group_valid_status', true),
	// 获取游戏规则阅读状态
	getUserGameRuleReadInfo: data => get(data, 0, 'group/ajax_user_game_rule_read_info', false),
	// 获取游戏配置信息
	getGameConfigInfo: data => get(data, 0, 'game/ajax_game_config_info', false),
	// 获取学生或教师身份查询可用计划
	getPlanList: data => get(data, 0, 'group/ajax_plan_list', false),
	// 获取词库列表
	getTypeList: data => get(data, 0, 'type/ajax_list', false),
	// 获取组别（汉英组别）
	getTypeListHy: data => get(data, 0, 'type/ajax_type_list', false),
	// 获取公告信息
	getNoticeList: data => get(data, 0, 'notice/ajax_list', false),
	// 更新是否加入排行榜
	updateJoinRank: data => post(data, 0, 'user/ajax_update_join_rank'),
	// 获取用户的答题记录信息
	getRankDetail: data => get(data, 0, 'rank/ajax_rank_detail', false),
	// 获取字母信息
	getLetterInfo: data => get(data, 0, 'letter/ajax_list', false),
	// 获取配置信息
	getConfigInfo: data => get(data, 0, 'config/ajax_info', false),
	// 获取更新app信息
	getUpdateAppInfo: data => get(data, 0, 'config/ajax_update_app_info', false),
	// 获取搜索条件
	getRankSearchTypeInfo: data => get(data, 0, 'bigrank/get_search_type_info', false),

	// 扫码
	scanQr: data => post(data, 0, 'user/ajax_handler_vip'),
	// 获取蜂竞技过期时间
	getUserInfoData: data => get(data, 0, 'user/ajax_user_info', false),
	// 授权登录
	snAndPhoneJoin: data => post(data, 1, "user/snAndPhoneJoin"),

	// 老师端 班级列表
	getStudentGradeClassList: data => get(data, 1, "pczxTeacher/gradeList", false),
	// 老师端 学生列表
	getStudentByGradeClass: data => get(data, 1, "pczxTeacher/studentList", false),

	// 蜂talk
	// 传入字符串返回ai回答内容
	contentToMp3: data => get(data, 0, 'alvoice/fn_content_to_mp3'),
	// 获取类型列表
	getTestTypeList: data => get(data, 0, 'test/ajax_type_list', false),

	// 创建评测会话
	aievalInit: data => post(data, 2, "aieval/init"),
	// 上传音频文件
	upLoadFeedFile: data => post(data, 2, "aieval/record/feed"),
	// 实时获取评测结果
	getFetchFile: data => get(data, 2, "aieval/record/fetch", false),
	// 销毁评测会话
	destructionFetchFile: data => get(data, 2, "aieval/record/release"),
	// 异步获取评测结果
	asyncGetFetchFile: data => get(data, 3, "results"),
	// 首页banner
	getBanner: data => post(data, 0, "focus/ajax_list"),



	// ===============口语评测
	// 获取题目列表
	ajax_test_list: data => post(data, 0, 'test/ajax_test_list', false),
	// 获取答题列表
	ajax_test_card_record_info: data => post(data, 0, 'test/ajax_test_card_record_info'),
	// 提交答题内容
	ajax_update_test_user_record: data => post(data, 0, 'test/ajax_update_test_user_record', false),
	// 保存音频文件
	ajax_save_mp3: data => post(data, 0, 'user/ajax_save_mp3'),
	chatOneRoundMatch: data => post(data, 1, 'kimi/chatOneRoundMatch'),

	// 获取游戏规则
	getGameRules: data => get(data, 0, 'game/ajax_game_info', false),
	// 提交英语写作测评信息
	submitEng: data => post(data, 0, 'test/ajax_article_evaluation_info'),

	// 获取识图叙事任务列表页
	getPczxIconicLiteracy: data => get(data, 1, 'pczxIconicLiteracy/list'),
	// 获取识词发音任务列表
	getPczxRecognitionLiteracy: data => get(data, 1, 'pczxRecognition/list'),
	// 获取场景配音任务列表
	getPczxDubbing: data => get(data, 1, 'pczxDubbing/list'),
	// 获取场景配音的详情
	getPczxDubbingInfo: data => get(data, 1, 'pczxDubbing/info', false),
	// 识图叙事提交答题结果
	submitPczxDubbing: data => post(data, 1, 'pczxDubbing/saveAnswer'),

	// 获取话题思考任务列表
	getPczxLecture: data => get(data, 1, 'pczxLecture/list'),
	// 获取话题思考的详情
	getPczxLectureInfo: data => get(data, 1, 'pczxLecture/info'),
	// 话题思考提交答题结果
	submitPczxLecture: data => post(data, 1, 'pczxLecture/saveAnswer'),


	// 获取识图叙事的详情
	getPczxIconicLiteracyInfo: data => get(data, 1, 'pczxIconicLiteracy/info'),
	// 识图叙事提交答题结果
	submitPczxIconicLiteracy: data => post(data, 1, 'pczxIconicLiteracy/saveAnswer'),

	// 获取识词发音详情
	getPczxRecognitionLiteracyInfo: data => get(data, 1, 'pczxRecognition/info'),


	// 发音提交答题结果
	submitSCFYLiteracy: data => post(data, 1, 'pczxRecognition/saveAnswer', false),

	// 根据单词获取单词音频
	getWordVoice: data => post(data, 0, 'alvoice/fn_get_word_voice_nologin', false),

	// 获取文章阅读的列表数据
	getReadList: data => get(data, 1, 'pczxRead/list'),

	// 匹配房间
	getPipeiInfo: data => post(data, 0, 'group/ajax_pipei_group_info', false),
}

export default api;